<div class="container" style="margin-top: 40px;">

    <form class="form-inline">
        <div class="midbox">
            <?php $this->component('Hr_SelectDePartMent');?>
            <button type="submit" class="btn btn-small">搜索</button>
            <div class="btn-group" style="float: right;">
                <!--<button class="btn btn-small disabled" disabled>共有<?=$data['dep_count']?>个部门，<?=$data['job_count']?>个职位</button>-->
                <span class="btn btn-small disabled" style="cursor:default;">共有<?=$data['dep_count']?>个部门，<?=$data['job_count']?>个职位</span>
            </div>
        </div>
    </form>

    <!--<table class="table" style="width: 750px;margin-left: 80px;">-->
    <table class="midbox table" style="margin-top: 20px;">
        <thead>
        <tr>
            <th>ID</th>
            <th>部门名称</th>
            <th>部门属性</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <?php if($data['dep_list']):?>
        <?php foreach($data['dep_list'] as $value):?>
        <tr>
            <td><?=$value['department_id']?></td>
            <td class="depaname"><?=$value['department_name']?></td>
            <td><?=$value['city_name']?>/<?=$value['bu_name']?>/<?=$value['function_name']?></td>
            <td>
                <a href="javascript:void(0);" class="view_position">查看</a>
                <a data-toggle="modal" href="#myModal" class="iconsu" depart="<?=$value['department_name']?>" departid="<?=$value['department_id']?>" skill='<?=$value['function_id']?>'>添加</a>
            </td>
        </tr>
        <?php endforeach;?>
        <?php endif;?>
        </tbody>
    </table>
    <div class="pagination pagination-centered">
        <?php if(isset($data['multipage']) && !empty($data['multipage']['list'])) {?>
        <?php $this->component('Hr_MultiPage', array('multipage'=>$data['multipage'])); ?>
        <?php } ?>
    </div>

    <?php /*添加职位*/?>
    <div class="modal fade panel" id="myModal" style="display: none;">
        <div class="modal-header">
            <a class="close" data-dismiss="modal">×</a>
            <h5>添加职位</h5>
        </div>

        <div class="modal-body">
            <form id="addDepart" class="form-horizontal myForm"  action="">
                <fieldset>
                <div class="control-group fst">
                    <label class="control-label">所在部门：</label>
                    <div class="controls docs-input-sizes">
                        <span class="depart"></span>
                        <input id="departID" name="departID" type="hidden" value=""/>
                        <input id="function_id_add" type="hidden" name="function_id"/>
                    </div>
                </div>

                <div class="jobItem">
                <div class="control-group">
                    <label class="control-label">职位选择：</label>
                    <div class="controls docs-input-sizes">
                        <input style="width: 180px;" maxlength="20" type="text" name="positionNames[0]" class="position"/>
                        <input type="hidden" name="positionID[0]" value="0" class="positionID"/>
                        <!--<select name="positionID[0]"  sel="sel" style="width:180px;"></select>-->

                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">计划编制：</label>
                    <div class="controls docs-input-sizes">
                        <input jhbz="jhbz" name="formation[0]" type="text" maxlength="4" class="{digits:true,range:[0,1000],messages:{digits:'必须是数字',range:'请输入1000以内的数字'}} span1"/> 人
                    </div>
                </div>
                </div>

                <div class="control-group">
                    <label class="control-label">&nbsp;</label>
                    <div class="controls docs-input-sizes">
                        <a class="contiAdd" href="javascript:void(0);">继续添加职位</a>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">&nbsp;</label>
                    <input type="submit" value="保存" class="btn btn-primary" style="height: 30px;" />
                    <span data-dismiss="modal" class="btn">取消</span>
                </div>
                <div id="err" style="margin: 0 0 0 100px; float: left; display: none" class="alert alert-error fade in"></div>
            </fieldset>
        </form>
    </div>
</div>
<?php /*添加职位*/?>


<!--弹出窗口begain-->
<div id="confirmDialog" class="modal hide dialog" style="width:350px" >
    <div class="modal-header">
        <a class="close" data-dismiss="modal">&times;</a>
        <h5 style="color: #555;">提示信息</h5>
    </div>
    <div class="modal-body" style="text-align: center; padding: 15px; 0 ; font-size: 14px;">
        您确定删吗？
    </div>
    <div class="modal-footer" style="padding: 8px 0; text-align: center;">
        <a href="javascript:;" class="btn btn-small btn-primary delok" data-dismiss="modal">确定</a>
        <a href="javascript:;" class="btn btn-small delcancle" data-dismiss="modal">取消</a>
    </div>
    <!--Modal footer-->
</div> <!--Modal-->
<!--弹出窗口end-->

<!--弹出窗口alert begain-->
<div id="alertDialog" class="modal hide">
    <div class="modal-header">
        <a class="close" data-dismiss="modal">&times;</a>
        <h5 style="color: #555;">提示信息</h5>
    </div>
    <div class="modal-body" style="text-align: center; padding: 15px; 0 ; font-size: 14px;">
        该部门下还有在职员工，不能被删除
    </div>
    <div class="modal-footer" style="padding: 8px 0; text-align: center;">
        <a href="javascript:;" class="btn btn-small btn-primary" data-dismiss="modal">确定</a>
    </div>
    <!--Modal footer-->
</div> <!--Modal-->
<!--弹出窗口alert end-->
<?php $this->script_block_begin();?>
<script language="javascript" type="text/javascript">
    var viewPositionUrl = '<?=Util_BaseUrls::ajax_dep_job()?>';
    var editPostionUrl = '<?=Util_BaseUrls::ajax_d_update()?>';
    var addPostionUrl = '<?=Util_BaseUrls::ajax_job_add()?>';
    var delPositionUrl = '<?=Util_BaseUrls::ajax_job_delete()?>';
    var searchPositionUrl = '<?=Util_BaseUrls::ajax_search_position()?>';
</script>
<?php $this->script_block_end();?>